<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Class中的get和set设置</title>
	</head>
	<body>
		<script>
			class Phone {
				get price() {
					console.log('价格属性被读取了...');
					return '999';
				}
				
				set price(val) {
					console.log('价格属性被设置了');
				}
			}
			
			let s = new Phone();
			console.log(s.price);
			s.price = 'free';
			console.log(s.price);
		</script>
	</body>
</html>